//Component Object
import { request,uploadFile2,getAliOssToken } from '../../utils/request.js'
import {
  isLogin
} from '../../utils/util.js'
let beJumpPage = '' // 记录要跳转的页面
Component({
  data: {
    loginDialogVisible:false,
  },
  methods: {
    loginDialogClose() {
      console.log('loginDialogClose')
      this.setData({
        loginDialogVisible: false,
      })
      if (beJumpPage) {
        wx.navigateTo({
          url: beJumpPage,
        })
      }
    },
  
    jumpToQuestionnaireList() {
      beJumpPage = ''
      console.log('跳转 isLogin:',isLogin())
      if(isLogin()){
        wx.navigateTo({
          url: '/pages/questionnaireList/questionnaireList',
        })
      }else {
        beJumpPage = '/pages/questionnaireList/questionnaireList'
        this.setData({
          loginDialogVisible: true,
        })
      }
    },
    
  },

  attached: function(){

  },

  detached: function(){

  },
});